1. Field of the Invention
This invention is generally related to smaller computer systems (such as workstations, personal computers, and laptop computers) and more particularly to computer systems provided with power management capabilities.
2. Description of the Related Art
Personal computer systems are becoming ever-more powerful. For example, there are laptop, notebook, and sub-notebook computer systems that are every bit as powerful as their desktop counterparts. Some desktop machines are achieving the computational power of workstations made just a few years ago, and workstations are now performing computational tasks that were once in the domain of mini, super-mini, and even mainframe computer systems.
The problems of power consumption and heat generation have become of greater concern as ever greater computing power is housed in ever smaller enclosures. In battery-powered computers, such as notebook computers, sub-notebook computers, personal digital assistants (PDA's), etc., power conservation is required to increase battery life and thereby increase the period of time that the computer can be used prior to recharging or replacing the batteries.
Desktop personal computers and workstations, on the other hand, are typically not battery powered. However, some form of power management is often still desirable. One reason is that a typical desktop computer system can consume several hundred watts of power per hour when it is turned on, whether or not it is being used. This energy consumption can be quite expensive, particularly in the context of large companies and other institutions which may have hundreds or even thousands of desktop computer systems turned on both day and night.
Another reason that power management may be desirable for desktop machines is that it is usually desirable minimize the heat generated by such machines. The new generation of high-speed microprocessors, often operating in a frequency range of 50 MHz or more, generate considerable heat, which must be effectively dissipated to prevent the degradation of heat-sensitive components of the computer system. If power consumption of the desktop computer system is reduced, heat generation is reduced, thereby reducing the cooling requirements for the computer system.
In the past, power consumption has been reduced by reducing the clock rate of the central processing unit (CPU) of the computer system. This reduces power consumption because the amount of power consumed by a CPU is directly related to the clock rate of the CPU. In one scenario, if the computer system starts to overheat, the clock rate to the CPU can be reduced, thereby reducing the power consumed and heat generated by the CPU. Alternatively, the clock rate of the CPU can be reduced when little or no CPU activity is detected, or when the battery voltage drops below a predetermined threshold, or by explicit user command.
Such power conservation systems are adequate for stand-alone computer systems, or for personal computer systems hooked together in simple networks. However, as will be explained in greater detail below, such power conservation techniques are not well adapted to UNIX-based network computer systems that are becoming common in the industry.
UNIX-based computer systems are interrupt-driven systems where the computer normally exists in an "idle loop" awaiting an event to be processed. If an interrupt is detected, it is handled by the CPU before the system re-enters the idle loop. A UNIX-based workstation such as a SUN SPARCstation 2 workstation can have 15 levels of interrupts, numbered from 1 to 15, where the higher the number of the interrupt the greater its priority level. As an example, if a UNIX-based computer system is processing a level 2 interrupt and a level 10 interrupt is detected by the CPU, the level 10 interrupt task will be handled prior to the completion of the level 2 interrupt task.
In FIG. 1a, a process 10 of a UNIX-based computer system of the prior art is illustrated. This process 10 is often referred to as the "UNIX kernel", i.e. is the basic, underlying process of the UNIX operating system. The process 10 begins at 12 (typically with the power-up of the system) and, in a step 14, the computer system is initialized. In particular, the interrupt tables of the system are cleared and initialized. After the initialization process of step 14, the interrupt and direct memory access (DMA) capabilities of the system are enabled in the step 16. Then, as illustrated at step 18, the basic CPU functions are performed. Events that can change or modify the normal flow of the CPU processing include interrupts and DMA requests.
DMA requests are hardware-type events which are handled by the CPU by methods well known to those skilled in the art. However, the most common type of event in a UNIX-based system is the interrupt event. The response of the CPU to an interrupt during the "perform CPU function" step 18 of FIG. 1a is illustrated in greater detail in FIG. 1b.
In FIG. 1b, process 18 begins at 20, and then immediately enters an "idle loop" comprising the "No Operation" (NOP) step 22. The microprocessor will remain in the idle loop until an interrupt 23 causes the microprocessor to jump to a master interrupt handler 24. The master interrupt handler determines the level of priority of the interrupt and hands it to an appropriate handler such as handlers 25, 26, 28, 30, and 32. By way of example, 15 levels of interrupts may be handled, ranging from a level 1 handler to a level 15 handler. Each of the handlers is associated with a particular type of function. For example, a "level 2" handler 26 is responsive to dynamic system changes, such as the insertion or removal of an Ethernet.RTM. cable. A "level 10" handler 30, in this example, is a "housekeeping" handler which is evoked every 10 milliseconds to perform basic housekeeping functions such as monitoring the scheduler queues, updating time-dependent processes (such as a clock displayed on the screen of the computer), etc. Other handlers can be used for the input/output (referred to herein sometimes as "I/O" or "peripheral") devices of the system. Some handlers, such as a "level X" handler 28 (where X is somewhere between 2 and 10 in this example), can be used to initiate user processes. For example, the level X handler can be triggered by keystrokes from a keyboard (a "level X interrupt") and, when a recognizable string is in an event queue, it can launch a user routine or program. It is important to note, however, after a handler has completely handled an interrupt (including any chain of user or other system processes) that the process control is returned to point A and the process 18 once again enters the idle loop.
As indicated by the broken-line arrows pointing to the master interrupt handler, it is possible for a handler, such as one of handlers 25-32, to be itself interrupted and process control turned over to the master interrupt handler 24. Any number of interrupts are possible up to a maximum number in an interrupt stack. After the handlers have completed their handling of all stacked interrupt events, process control is returned to point A and the process 18 once again enters its idle loop.
FIG. 1c illustrates a typical handling of an interrupt generated by an input/output (I/O) or peripheral device. The process 35 begins at 36 with a detection of an interrupt from a peripheral device and, in a step 38, the peripheral device is set up. Next, in a step 40, the data is transferred, and the process ends at step 42.
The difficulty in providing power management for a UNIX-based computer system is that the system must always be functional enough to quickly handle interrupts, DMA requests, and the like. In the example given, a level 10 or "housekeeping" interrupt is generated by the hardware of the system every 10 milliseconds, and must be handled in an expeditious manner. Therefore, reducing the frequency of the CPU clock would be a poor solution to the problem, and completely turning off the CPU without providing for the monitoring of interrupts and DMA requests could prove to be disastrous for the system, causing a failure of the UNIX kernel.
Despite the difficulty in providing power management for UNIX-based computer systems, such management is highly desirable. It is estimated that a typical small computer system may be processing data less than 1 percent of the time that it is turned on. In the case of the aforementioned UNIX-based computer system, this means that the computer spends most of its time in the idle loop comprising the NOP step 22 of FIG. 1b. The performance of a NOP step consumes just as much energy as steps having a useful purpose. It has been estimated that as many as 500,000 NOPs are executed between each level 10 interrupt of a UNIX-based system. The execution of these NOPs therefore consume the vast majority of the system's power requirements.